package com.auroramanito.uaa.domain.dto;

import com.auroramanito.uaa.annotation.ValidEmail;
import com.auroramanito.uaa.annotation.ValidPassword;
import com.auroramanito.uaa.config.Constants;
import lombok.Data;

import javax.validation.constraints.*;
import java.io.Serializable;

/**/
@Data
public class UserDTO implements Serializable {
    @NotNull
    @NotBlank
    @Size(min = 4,max = 50,message = "用户名长度在4-50个字之间")
    private String username;
    @NotNull
//    @NotBlank
//    @Size(min = 4,max = 50,message = " 密码长度在4-50个字之间")
    @ValidPassword
    private String password;


    @NotNull
    @Pattern(regexp = Constants.PATTERN_MOBILE)
    private String mobile;
    @NotNull
//    @NotBlank
//    @Size(min = 4,max = 50,message = "密码长度在4-50个字之间")
    @ValidPassword
    private String matchingPassword;
    @NotNull
//    @Email
//    @Pattern(regexp = "^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(\\.[a-zA-Z0-9_-]+)+$")
    @ValidEmail
    private String email;
    @NotNull
    @NotBlank
    @Size(min = 4,max = 50,message = "密码长度在4-50个字之间")
    private String name;
}
